<template>
  <div class="BuyCar">
    <div class="order_info">
      <img src="../../static/image/aa.jpg">
      <p>{{ className }}</p>
      <span>￥89.00</span>
      <span>数量：1</span>
    </div>

    <div class="BuyBottom">
      <div class="btn_money">
        <span @click="addShop">确认支付</span>
      </div>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  data(){
    return{
      className:'',
        Shop:{
          shopname:'',
          shoper:'',
          shoperID:'',
          status:'已支付'
        }
    }
  },
  methods:{
     addShop(){
       this.Shop.shoper=JSON.parse(sessionStorage.getItem('user')).name
       this.Shop.shoperID=JSON.parse(sessionStorage.getItem('user')).id
       this.Shop.shopname=this.className
       axios.post('http://localhost:9999/addShop',{params:this.Shop}).then((res)=>{
         if (res.data.code==200){
           this.$router.push('/vip')
         }
       })
     }
  },
  created() {
    this.className=this.$route.params.className
  }
}
</script>

<style scoped>
.order_info{
  width: 98%;
  position: absolute;
}
.order_info img{
  height: 60px;
  width: 80px;
}
.order_info p{
  position: absolute;
  top: 0;
  display: inline-block;
  margin-top: 0;
}
.order_info span{
  color: #E33E33;
}
.order_info span:nth-child(4){
  margin-left: 10px;
}

.BuyBottom .btn_money{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: #E33E33;
  border-radius: 40px;
  text-align: center;
}
.BuyBottom .btn_money span{
  line-height: 50px;
  color: white;
}

</style>